<?php

namespace app\validate;

use think\Validate;

class FileValidate extends Validate
{
    protected $rule = [
        'image|图片'         => 'require|fileMime:image/jpeg,image/png|fileSize:10000000',
        //TODO 暂时10m
        'excel|表格'         => 'require|fileSize:10000000',
        'file|文件'         => 'require|fileSize:100000000',
    ];

    protected $message  =   [
        'image.fileSize' => '图片过大，最大不能超过10MB',
        'image.fileMime' => '图片格式错误',
        'excel.fileSize' => '表格过大，最大不能超过10MB',
//        'excel.fileMime' => '图片格式错误',
    ];

    protected $scene = [
        'image' => ['image'] ,
        'file' => ['file'] ,
        'excel' => ['excel'] ,
    ];

}